
import { reqtrade } from "@/API/index"
const actions = {

    //获取地址和商品信息
    async trade({ commit }) {
        let tradeact = await reqtrade()
        if (tradeact.code == 200) {
            commit("trademut", tradeact.data)
        }
    },

}
const mutations = {
    trademut(state, data) {
        return state.tradedata = data;
    }
}
const state = {
    tradedata: {}

}
const getters = {
    userAddressList(state) {
        return state.tradedata.userAddressList || [];
    },


    detailArrayList(state) {
        return state.tradedata.detailArrayList || [];
    },


    tradeNo(state) {
        return state.tradedata.tradeNo;
    }
}



export default {
    actions,
    mutations,
    state,
    getters
}